package com.tvunetworks.center.user.model.vo;

import com.tvunetworks.center.common.util.MyTimeUtil;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.HashMap;
import java.util.Map;

/**
 * @program: tvucc-aggregator
 * @description: UserInstanceVo
 * @author lebronchen
 * @create: 2020-04-24 09:39
 **/
@Data
@Accessors(chain = true)
public class UserInstanceVo {

    private String id;
    private String instanceId;
    private String region;
    private String peerId;
    private String publicIp;
    private String privateIp;
    private String createUserId;
    private String createUserEmail;
    private String shutdownUserId;
    private String shutdownUserEmail;
    private Long createTime;
    private Long shutdownTime;
    private int status;
    private String imageType;
    private String webRUrl;

    private String remark;
    private Long scheduleShutdownTime;

    /**
     *
     * @return Map
     */
    public Map<String, Object> convertToEmailParam(){
        Map<String, Object> map = new HashMap<>();
        map.put("Instance ID", instanceId);
        map.put("Region", region);
        map.put("Cloud R ID", peerId);
        map.put("IP", publicIp);
        map.put("Start-up Time(UTC)", this.getCreateTime() != null ? MyTimeUtil.format2UTCTimestamp(this.getCreateTime()): "");
        map.put("Schedule Shutdown Time(UTC)", this.getScheduleShutdownTime() != null ? MyTimeUtil.format2UTCTimestamp(this.getScheduleShutdownTime()): "");
        return map;
    }

}
